"""
-------------------------------------------------
    Author: Csm
    Date：2021-03-01 11:27
-------------------------------------------------
"""

import os
import sys
import django
from channels.routing import get_default_application

# application加入查找路径中
# zanhu directory.
# from pathlib import Path
# ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent
# sys.path.append(str(ROOT_DIR / "zanhu"))  # ../zanhu/zanhu

# application加入查找路径中
app_path = os.path.abspath(os.path.join(
    os.path.dirname(os.path.abspath(__file__)), os.pardir))
sys.path.append(os.path.join(app_path, 'zanhu'))

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local')
django.setup()
application = get_default_application()

# application = ProtocolTypeRouter({
#   "http": AsgiHandler(),
#   # Just HTTP for now. (We can add other protocols later.)
# })
